package weekendpractice.Practice3_12;

public class Puppy {
    String name;

    public Puppy(String name) {
        this.name = name;
    }
    public Puppy(){}

    public String getName() {
        return name;
    }

    public void setName(String name) throws DogNameException {
        if ("Dog".equals(name)){
            throw new DogNameException("Dog can't be named as Dog!!!");
        }
        this.name = name;
    }
}
